When a root is set on a widget, the style context may
already exist. We need to make sure that the style context
has the right display set.
This was showing up as "css spillover" in the inspector.
Closes: #https://gitlab.gnome.org/GNOME/gtk/issues/1817
priv->root = priv->parent->priv->root;
+ if (priv->context)
+ gtk_style_context_set_display (priv->context, gtk_root_get_display (priv->root));
+
GTK_WIDGET_GET_CLASS (widget)->root (widget);
g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_ROOT]);
GTK_WIDGET_GET_CLASS (widget)->unroot (widget);
+ if (priv->context)
+ gtk_style_context_set_display (priv->context, gdk_display_get_default ());
+
priv->root = NULL;
g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_ROOT]);